/**
 *<p>Copyright: Copyright (c) 2012</p> 
 *<p>Company: SCPII</p>
 *<p>Project:scpii-api</p>
 *@author xiezhouyan
 *@Date 2013-2-21 上午11:42:36
 *@version 1.0
 *@description:
 */
package com.scpii.api.controller.content;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.scpii.api.common.annoation.Pagination;
import com.scpii.api.common.base.BaseController;
import com.scpii.api.domain.content.Categories;
import com.scpii.api.service.content.CategoriesService;

@Controller
@RequestMapping("/content/categories")
public class CategoriesController extends BaseController {

	@Resource
	private CategoriesService categoriesService;

	@PreAuthorize("hasRole('ROLE_CLIENT')")
	@RequestMapping(value = "/parent/{parentId}", method = RequestMethod.GET)
	@ResponseBody
	@Pagination
	public List<Categories> getCategoriesByParentId(Categories categories) {
		return categoriesService.selectBySelective(categories);
	}

}
